<script setup>
	import { onLaunch } from '@dcloudio/uni-app';
	import {useStore} from "./store/deviceInfo.js";
	const deviceInfo = useStore()
	onLaunch(()=>{
		console.log('App Launch 新语法')
		// 获取当前的设备信息
		uni.getSystemInfo({
			success:(e)=>{
				console.log(e,'事件对象')
				console.log(e.statusBarHeight,"高度");
				console.log(deviceInfo,"这里")
				 // deviceInfo.$patch({
				 //    deviceTopBar: 33,
				 //  })
				 // 根据不同的设备计算高度
				 // #ifdef APP-PLUS || H5
				 let deviceTopBar = 0;
				 if (e.platform == 'android') {
				 
				 	// Vue.prototype.CustomBar = e.statusBarHeight + 50;
				 	deviceTopBar = e.statusBarHeight + 10;
				 
				 } else {
				 	// Vue.prototype.CustomBar = e.statusBarHeight + 45;
				 	deviceTopBar = e.statusBarHeight +10;
				 };
				 deviceInfo.$patch({
				    deviceTopBar: deviceTopBar,
				  })
				 // #endif
				 
			}
		})
	})
</script>
<script>
	export default {
		onLaunch: function() {
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	@import url(./style.scss);
	/*每个页面公共css */
</style>
